package com.slz3.business.module.goodsManagement.gooTypeLevel2.steward;

import com.slz3.business.module.goodsManagement.gooTypeLevel2.domain.GooTypeLevel2;
import com.slz3.business.module.goodsManagement.gooTypeLevel2.domain.GooTypeLevel2Condition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class GooTypeLevel2Response {

    @Resource
    GooTypeLevel2ResController gooTypeLevel2ResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2.class).flatMap(gooTypeLevel2 ->
                gooTypeLevel2ResController.add(req, gooTypeLevel2)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.delete(req, gooTypeLevel2Condition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2.class).flatMap(gooTypeLevel2 ->
                gooTypeLevel2ResController.modify(req, gooTypeLevel2)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return gooTypeLevel2ResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return gooTypeLevel2ResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return gooTypeLevel2ResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.auditSubmit(req, gooTypeLevel2Condition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.audit(req, gooTypeLevel2Condition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.auditReject(req, gooTypeLevel2Condition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.usingEnable(req, gooTypeLevel2Condition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(GooTypeLevel2Condition.class).flatMap(gooTypeLevel2Condition ->
                gooTypeLevel2ResController.usingDisable(req, gooTypeLevel2Condition)
        );
    }   

}
